package Level_two;

import java.text.DecimalFormat;
import java.util.Scanner;

public class Three {
    public static void main(String[] args) {
        //.键盘录入学员张浩的3门课程(Java、SQL、Web)的成绩
        System.out.println("请输入Java的成绩：");
        int score_Java = new Scanner(System.in).nextInt();
        System.out.println("请输入SQL的成绩：");
        int score_SQL = new Scanner(System.in).nextInt();
        System.out.println("请输入Web的成绩：");
        int score_Web = new Scanner(System.in).nextInt();
        //(1)Java课程和SQL课程的分数值差
        int difference = score_Java - score_SQL;
        //(2)3 门课程的平均分
        double average = (score_Java + score_SQL + score_Web) / 3.0;
        //(3)3 门课程的平均分保留两位小数
        DecimalFormat df = new DecimalFormat("#.00");
        String average_str = df.format(average);
        double average_str_D = Double.parseDouble(average_str);
        //把差值转化为绝对值
        difference = Math.abs(difference);
        System.out.println("Java课程和SQL课程的分数值差为：" + difference);
        System.out.println("3门课程的平均分为：" + average_str_D);

    }
}

